package com.grgbanking.it.system.service;

import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import com.grgbanking.it.common.entity.PageQuery;
import com.grgbanking.it.system.entity.User;

/**
 * 用户
 * 
 * IUserService
 * 
 * @author 潘广伟
 * @Email p_3er@qq.com
 * @Date 2014-12-16 上午8:30:39
 * 
 * @version 1.0.0
 *
 */
public interface IUserService {
	/**
	 * 用户登录
	 * @param user
	 * @return
	 */
	public User login(User user)throws Exception ;
	/**
	 * 获取用户数据
	 * findUsersToJson
	 * 
	 * @param query
	 * @param name
	 * @param departmentId
	 * @return
	 * @throws Exception 
	 * @exception 
	 * @since  1.0.0
	 */
	public String findUsersToJson(PageQuery query,String name,String departmentId) throws Exception;
	/**
	 * 获取所有的工程师
	 * findUsersOfIT
	 * 
	 * @return
	 * @throws Exception 
	 * @exception 
	 * @since  1.0.0
	 */
	public List<User> findEngineers() throws Exception; 
	/**
	 * 为用户分配角色
	 * updateDistributeRoles
	 * 
	 * @param userId
	 * @param roleIds
	 * @throws Exception 
	 * @exception 
	 * @since  1.0.0
	 */
	public void updateDistributeRoles(String userId,String roleIds) throws Exception;
	/**
	 * 根据用户名查找用户
	 * getUserByUsername
	 * 
	 * @param username
	 * @return
	 * @throws Exception 
	 * @exception 
	 * @since  1.0.0
	 */
	public User getUserByUsername(String username) throws Exception; 
	/**
	 * 根据微信传过来的Code获取用户
	 * getUserByCode
	 * 
	 * @param code
	 * @param agentId
	 * @return
	 * @throws Exception 
	 * @exception 
	 * @since  1.0.0
	 */
	public User getUserByCode(String code,Integer agentId)throws Exception;
	/**
	 * 导出所有微信用户
	 * exportUserFromWX
	 * 
	 * @return
	 * @throws Exception 
	 * @exception 
	 * @since  1.0.0
	 */
	public HSSFWorkbook exportUserFromWX()throws Exception;
}